package com.atguigu.exer;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 *
 *
 *
 */
public class ListExer {
    /*
    区分List中remove(int index)
    和remove(Object obj)
     */
    @Test
    public void text1(){
        List list = new ArrayList();
        list.add(1);
        list.add(2);
        list.add(3);
        updatelist(list);
        System.out.println(list);
    }

    private void updatelist(List list){
        list.remove(2);//删位置为2
        list.remove(new Integer(2));//删对象为2
    }
}
